/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller.XML;

import agh.rozproszony.model.Message;
import java.util.Comparator;

/**
 *
 * @author Seweryn
 */
public class Komparator implements Comparator<Message> {
    @Override public int compare(Message m1, Message m2) { 
        if(m2 == null) return -1;
        if(m1.getRecipientId() > m2.getRecipientId())return 1;
        else if(m1.getRecipientId() < m2.getRecipientId()) return -1;
        else return 0;
    }

//Czytaj więcej na: http://javastart.pl/klasy/arrays-operacje-na-tablicach/#ixzz2WPTrXbmi
    
}
